package com.zff.tool;

import java.util.Random;

/**
 * TODO
 * @version 1.0
 * @author Zff
 * @date 2020/8/31 10:16
 */
public class RandomString {

    public static String getRandomString(int length){
        String str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        Random random=new Random();
        StringBuffer sb=new StringBuffer();
        for(int i=0;i<length;i++){
            int number=random.nextInt(62);
            sb.append(str.charAt(number));
        }
        return sb.toString();
    }

}
